package com.snailhd.common.entity;

import lombok.Getter;

import java.io.Serializable;

/**
 * ClassName IResult
 * Description TODO
 * Author hd
 * Date 2019-05-21 23:12
 */
@Getter
public class IResult<T> implements Serializable {

    private T data;

    private SubMsgResult subMsg;

    public IResult(){}

    public IResult(T data){
       this.data = data;
    }

    public boolean isFail(){
        return subMsg !=null;
    }

    public IResult<T> setData(T data) {
        this.data = data;
        return this;
    }

    public IResult<T> setSubMsg(SubMsgResult subMsg) {
        this.subMsg = subMsg;
        return this;
    }
}
